<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento senza titolo</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">




$(document).ready(function(){

$("div#out").html("test");


$("input").keypress(function (e) {





     // if (e.which == 32 || (65 <= e.which && e.which <= 65 + 25)
      //               || (97 <= e.which && e.which <= 97 + 25)) {
						
        var c = String.fromCharCode(e.which);
        $("p").append($("<span/>"))
              .children(":last")
              .append(document.createTextNode(c));
      /*
	  } else if (e.which == 8) {
        // backspace in IE only be on keydown
        $("p").children(":last").remove();
      }
	  */
	  
    $("div#out").text(e.which);
     //  $("div#out").text("s".charCodeAt(0));

/*
charCode
var code;
	if (!e) var e = window.event;
	if (e.keyCode) code = e.keyCode;
	else if (e.which) code = e.which;
	var character = String.fromCharCode(code);
	alert('Character was ' + character);
*/


alert("ciao");
$("#ajax").get("test.txt", function(data){
  alert("Data Loaded: " + data);
},"json");

 $("#ajax").ajaxSuccess(function(evt, request, settings){
   $(this).append("<li>Successful Request!</li>");
 });


}
)

})


</script>

</head>

<body>

<form action="" method="get"><input id="insert" name="insert" type="text" /></form>
<div id="out">ciao</div>
<p></p>


<div id="ajax">AJAX</div>
</body>
</html>
